package com.woniuxy.rms.dao;

import com.woniuxy.rms.pojo.Admins;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface AdminMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Admins record);

    int insertSelective(Admins record);

    Admins selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Admins record);

    int updateByPrimaryKey(Admins record);

    @Select("select * from admin where account = #{value}")
    Admins findByAccount(String account);

    List<Admins> findByRoleIds(List<Integer> roleIds);

    @Select("select admin.*,roles.role from admin left join roles on admin.role_id = roles.id")
    List<Admins> findByPage(Integer currentPage, Integer pageSize);
}